﻿
/** Pete's Tools package */
package pete.tools
{
	
	
	
	
	
	
/**
 * @version
 * -----
 *
 * @description 
 * -----
 * 
 * @example
 * -----
 */
public class ArrayIterator implements Iterator
{
	
	
	
	
	
	
	// Properties
	// -----------------------------------------------------------
	
	/**
	 * -----
	 */
	private var list:Array;
	
	/**
	 * -----
	 */
	private var index:int;
	
	
	
	
	
	
	// Constructor
	// -----------------------------------------------------------
	
	/**
	 * -----
	 */
	public function ArrayIterator( list:Array )
	{
		this.list = list;
	}
	
	
	
	
	
	
	// Functions
	// -----------------------------------------------------------
	
	/**
	 * -----
	 */
	function hasNext():Boolean
	{
		if ( index >= list.length
		  || list[ index ] == null )
		{
			return false;
		}
		else
		{
			return true;
		}
	}
		
	
	function next():Object
	{
		var item:Object = list[ index ];
		index++;
		
		return item;
	}
	
}
	
}